﻿using System;
using Hopscotch.Presentation.Common;
using Hopscotch.Presentation.Common.Utils;
using Hopscotch.Presentation.DiagnosticsModule.Constants;
using Hopscotch.Presentation.DiagnosticsModule.Views;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;

namespace Hopscotch.Presentation.DiagnosticsModule
{
    public class Module : IModule
    {
        private readonly IUnityContainer container;
        private readonly IAppController shellController;

        public Module(IUnityContainer container, IAppController shellController)
        {
            this.container = container;
            this.shellController = shellController;
        }

        public void Initialize()
        {
            var uri = new Uri(IconPaths.Wrench16);

            // Register other view objects with DI Container (Unity)
            container.RegisterType<Object, SystemDiagnosticsView>(typeof(SystemDiagnosticsView).Name);

            shellController.RegisterTool("Diagnostics", typeof(SystemDiagnosticsView), uri);
        }
    }
}
